<!-- HIS接口设置 -->
<template>
    <div style="height: 100%; width: 100%; position: relative" ref="buttondiv">
        <div class="pagetop">
            <div style="width: 100%">
                <el-col>
                    <div>
                        <vxe-toolbar>
                            <template v-slot:buttons>
                                <table>
                                    <tr>
                                        <td>快速查找</td>
                                        <td>
                                            <el-input v-model="qcodetable" @keyup.enter.native="QueryHisTable()"
                                                style="width: 160px"></el-input>
                                        </td>
                                        <td>所属医院</td>
                                        <td>
                                            <rm-ddl-common datatype="hospital" v-model="selhospcode" dataname="医院"
                                                width="160px" :appendtobody="true" @change="QueryHisTable"></rm-ddl-common>
                                        </td>
                                        <td style="width: 2000px"></td>
                                        <td>
                                            <el-button icon="el-icon-set-up" :disabled="changeflag"
                                                @click="StartInterface()">{{ buttontxt }}</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button icon="el-icon-plus" @click="btn_addhisinterface_clickEvent"
                                                v-has="'PADD'" :disabled="changeflag">新增</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button icon="el-icon-delete" @click="btn_delhisinterface_clickEvent"
                                                v-has="'PDELETE'"
                                                :disabled="changeflag || tab_showflag != 'tabname_jbxx'">删除</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button icon="el-icon-document" @click="SaveAll()" v-has="'PMODIFY'"
                                                :disabled="!changeflag">保存</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button icon="el-icon-document" @click="CancelChange()" v-has="'PMODIFY'"
                                                :disabled="!changeflag">取消</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button icon="el-icon-link"
                                                @click="btn_testconnect_clickEvent">测试连接</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button icon="el-icon-link"
                                                @click="btn_testallconnect_clickEvent">测试全部连接</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button icon="el-icon-link"
                                                @click="btn_servicestatus_clickEvent">后台状态</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button icon="el-icon-refresh-right"
                                                @click="btn_interface_clickEvent">重启接口</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button @click="ExportCsv()" icon="el-icon-files">导出</el-button>
                                        </td>
                                        <td style="align: left">
                                            <el-button @click="ImportCsv()" icon="el-icon-files">导入</el-button>
                                        </td>
                                    </tr>
                                </table>
                            </template>
                        </vxe-toolbar>
                    </div>
                </el-col>
            </div>
        </div>
        <div class="pagecenter" v-loading="pageinitloading" element-loading-spinner="el-icon-loading"
            element-loading-background="rgba(0, 0, 0, 0.8)">
            <rm-layout-right splitcolor="#ffffff" :splitwidth="3" :fixsize="670" :minfixsize="670" ref="layoutright">
                <div style="height: 100%">
                    <vxe-table keep-source :data.sync="main_his_interface_data" :loading="main_his_interface_loading"
                        :checkbox-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="auto"
                        highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow
                        ref="his_interface_table" resizable show-overflow size="mini" stripe
                        :row-class-name="GetRowClassName" show-header-overflow
                        @current-change="his_interface_table_changeEvent" header-align="center">
                        <vxe-table-column field="his_code" sortable title="接口编码" width="120" header-align="center"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="his_name" sortable title="接口名称" width="120"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="hospitalname" sortable title="医院编号" width="155"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="inuse" sortable title="是否启用" width="70" show-overflow align="center">
                            <template v-slot="{ row, rowIndex, columnIndex }">
                                <div :key="row.userno + rowIndex + columnIndex">
                                    <el-checkbox v-model="row.inuse" disabled></el-checkbox>
                                </div>
                            </template>
                        </vxe-table-column>
                        <vxe-table-column field="isdebug" sortable title="调试状态" width="70" show-overflow align="center">
                            <template v-slot="{ row, rowIndex, columnIndex }">
                                <div :key="row.userno + rowIndex + columnIndex">
                                    <el-checkbox v-model="row.isdebug" disabled></el-checkbox>
                                </div>
                            </template>
                        </vxe-table-column>
                        <vxe-table-column field="servicethread" sortable title="后台独立线程" width="90" show-overflow
                            align="center">
                            <template v-slot="{ row, rowIndex, columnIndex }">
                                <div :key="row.userno + rowIndex + columnIndex">
                                    <!-- <el-checkbox v-model="row.servicethread" disabled></el-checkbox> -->
                                    {{ Number(row.servicethread) === 0 ? "非独立线程" : "独立" + row.servicethread + "线程" }}
                                </div>
                            </template>
                        </vxe-table-column>
                        <vxe-table-column field="his_seq" sortable title="序号" width="50" show-overflow></vxe-table-column>
                        <vxe-table-column field="interfacetypename" sortable title="接口类型" width="110"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="dbms" sortable title="数据库类型" width="80" show-overflow></vxe-table-column>
                        <vxe-table-column field="servername" sortable title="服务器名称/IP" width="120"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="dbname" sortable title="数据库名称" width="115"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="dbparm" sortable title="其它链接参数" width="100"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="devclassname" sortable title="自定义对象名" width="125"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="logid" sortable title="登录账号" width="75" show-overflow></vxe-table-column>
                        <vxe-table-column field="barcodeheads" sortable title="处理条码前缀" width="85"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="barcodelens" sortable title="处理条码长度" width="85"
                            show-overflow></vxe-table-column>
                        <vxe-table-column field="nobarcodeundo" sortable title="无条码不执行" width="90" show-overflow
                            align="center">
                            <template v-slot="{ row, rowIndex, columnIndex }">
                                <div :key="row.userno + rowIndex + columnIndex">
                                    <el-checkbox v-model="row.nobarcodeundo" disabled></el-checkbox>
                                </div>
                            </template>
                        </vxe-table-column>
                        <vxe-table-column field="delayprocess" sortable title="延时处理时间(分)" width="85"
                            show-overflow></vxe-table-column>
                    </vxe-table>
                </div>
                <template v-slot:fix>
                    <div>
                        <el-tabs style="height: 100%" type="border-card" @tab-click="tab_getdata" v-model="tab_showflag">
                            <el-tab-pane label="详细信息" name="tabname_jbxx">
                                <table>
                                    <tr>
                                        <td>
                                            <font color="#F56C6C">接口编码</font>
                                        </td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.his_code"
                                                @input="HasChange"></el-input>
                                        </td>
                                        <td>
                                            <font color="#F56C6C">接口名称</font>
                                        </td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.his_name"
                                                @input="HasChange"></el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <font color="#F56C6C">医院编号</font>
                                        </td>
                                        <td colspan="2">
                                            <rm-ddl-common datatype="hospital" dataname="医院"
                                                v-model="his_interface_info_B.hospcode" width="190px" @change="HasChange"
                                                :disabled="canchangehosp"></rm-ddl-common>
                                        </td>
                                        <td>
                                            <font color="#F56C6C">序号</font>
                                        </td>
                                        <td style="width: 50px">
                                            <el-input v-model="his_interface_info_B.his_seq" @input="HasChange"></el-input>
                                        </td>
                                        <td>
                                            <!-- <el-checkbox v-model="his_interface_info_B.servicethread" @change="HasChange">是否后台独立线程</el-checkbox> -->
                                            线程
                                            <el-select v-model="his_interface_info_B.servicethread" style="width:100px"
                                                @change="servicethreadChange">
                                                <el-option v-for="(item, index) in servicethreadOption" :label="item.label"
                                                    :value="item.value" :key="index"></el-option>
                                            </el-select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <font color="#F56C6C">*</font>
                                        </td>
                                        <td colspan="2">
                                            <el-checkbox v-model="his_interface_info_B.inuse" disabled>是否启用</el-checkbox>
                                        </td>
                                        <td>
                                            <font color="#F56C6C">*</font>
                                        </td>
                                        <td colspan="2">
                                            <el-checkbox v-model="his_interface_info_B.isdebug"
                                                @change="HasChange">是否调试状态</el-checkbox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <font color="#F56C6C">接口类型</font>
                                        </td>
                                        <td colspan="2">
                                            <el-select v-model="his_interface_info_B.interfacetype" placeholder="请选择"
                                                style="width: 190px" @change="TypeChange">
                                                <el-option key="SQL" label="内置标准SQL配置" value="SQL"></el-option>
                                                <el-option key="WEB" label="标准WebService配置" value="WEB"></el-option>
                                                <el-option key="DEV" label="自定义接口对象" value="DEV"></el-option>
                                            </el-select>
                                        </td>
                                        <td>数据库类型</td>
                                        <td colspan="2">
                                            <el-select v-model="his_interface_info_B.dbms" placeholder="请选择"
                                                style="width: 190px" @change="DBChange" clearable>
                                                <el-option key="ODBC" label="ODBC" value="ODBC"></el-option>
                                                <el-option key="SQL" label="SQL" value="SQL"></el-option>
                                                <el-option key="ORACLE" label="ORACLE" value="ORACLE"></el-option>
                                                <el-option key="MYSQL" label="MYSQL" value="MYSQL"></el-option>
                                                <el-option key="" label="" value=""></el-option>
                                            </el-select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <font>自定义对象名</font>
                                        </td>
                                        <td colspan="4">
                                            <el-input style="width: 100%" v-model="his_interface_info_B.devclassname"
                                                @dblclick.native="readonlyflagb ? QueryHisInter() : ''" @input="HasChange"
                                                @change="HasChange" :placeholder="readonlyflagb ? '请选择自定义对象' : ''"
                                                :readonly="readonlyflagb" :disabled="disabledflagb">
                                                <i class="el-input__icon el-icon-menu" slot="suffix"
                                                    @click="QueryHisInter()" v-show="readonlyflagb"></i>
                                            </el-input>
                                        </td>
                                        <td>
                                            <el-button icon="el-icon-reading" @click="LookInterfaceDesc"
                                                :disabled="!his_interface_info_B.devclassname">查看接口说明</el-button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>服务器名称或IP</td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.servername"
                                                @input="HasChange"></el-input>
                                        </td>
                                        <td>数据库名称</td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.dbname"
                                                @input="HasChange"></el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <font>WebService地址</font>
                                        </td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.webinterurl"
                                                @input="HasChange" :disabled="disabledflagb"></el-input>
                                        </td>
                                        <td>其他连接参数</td>
                                        <td colspan="2">
                                            <el-input style="width: 100%" v-model="his_interface_info_B.dbparm"
                                                @input="HasChange"></el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>登录帐户</td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.logid"
                                                @input="HasChange"></el-input>
                                        </td>
                                        <td>帐户密码</td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.logpass"
                                                type="password" @dblclick.native="logpass_dblclick"
                                                @input="HasChange"></el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>超级用户账号</td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.superlogid"
                                                @input="HasChange"></el-input>
                                        </td>
                                        <td>超级用户密码</td>
                                        <td colspan="2">
                                            <el-input style="width: 190px" v-model="his_interface_info_B.superlogpass"
                                                type="password" @dblclick.native="superlogpass_dblclick"
                                                @input="HasChange"></el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>处理条码前缀</td>
                                        <td colspan="5">
                                            <el-input style="width: 100%" v-model="his_interface_info_B.barcodeheads"
                                                @input="HasChange"></el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>处理条码长度</td>
                                        <td colspan="2">
                                            <el-input style="width: 100%" v-model="his_interface_info_B.barcodelens"
                                                @input="HasChange"></el-input>
                                        </td>
                                        <td></td>
                                        <td colspan="2">
                                            <el-checkbox v-model="his_interface_info_B.nobarcodeundo"
                                                @change="nobarcodeundoChange">无条码不执行处理</el-checkbox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>延时处理时间(分)</td>
                                        <td colspan="5">
                                            <el-input style="width: 100%" v-model="his_interface_info_B.delayprocess"
                                                @input="HasChange"></el-input>
                                        </td>
                                    </tr>
                                </table>
                            </el-tab-pane>
                            <el-tab-pane label="接口方法明细" name="tabname_jkffmx">
                                <vxe-table keep-source :data.sync="tab_jkffmx_data" :loading="tab_jkffmx_loading"
                                    :checkbox-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border
                                    height="auto" highlight-current-row highlight-hover-column highlight-hover-row
                                    how-header-overflow ref="tab_jkffmx_table" show-overflow size="mini" stripe
                                    show-header-overflow resizable
                                    :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }"
                                    :edit-rules="tab_jkffmx_validRules" header-align="center"
                                    :cell-class-name="cellClassName">
                                    <!-- <vxe-table-column type="selection" width="40" align="center" header-align="center"></vxe-table-column> -->
                                    <vxe-table-column key="method_name" field="method_name" sortable title="接口方法"
                                        :edit-render="{ name: 'input' }" width="260px" show-overflow>
                                        <template v-slot:edit="{ row }">
                                            <el-input
                                                @keyup.space.native="(popdatatype = 'hismethod'), (tempItem = row), (dialogTableVisible = true)"
                                                @dblclick.native="(popdatatype = 'hismethod'), (tempItem = row), (dialogTableVisible = true)"
                                                v-model="row.method_name" style="width: 100%" readonly></el-input>
                                        </template>
                                    </vxe-table-column>
                                    <vxe-table-column key="inuse" field="inuse" sortable title="启用" width="50px"
                                        show-overflow align="center">
                                        <template v-slot="{ row, rowIndex, columnIndex }">
                                            <div :key="row.method_code + rowIndex + columnIndex">
                                                <el-checkbox v-model="row.inuse" @change="HasChange"></el-checkbox>
                                            </div>
                                        </template>
                                    </vxe-table-column>
                                    <vxe-table-column key="execmodename" field="execmodename" title="执行方式"
                                        :edit-render="{ type: 'default' }" width="130px">
                                        <template v-slot="{ row }">
                                            <div v-if="row.isAllowSelect">
                                                <el-select v-model="row.execmode" placeholder="" style="width: 100%"
                                                    size="mini" @change="execmodechange($event, row)">
                                                    <el-option key="1" label="实时执行" value="1"></el-option>
                                                    <el-option key="2" label="后台执行" value="2"></el-option>
                                                </el-select>
                                            </div>
                                            <div v-else>
                                                <el-select v-model="row.execmode" placeholder="" style="width: 100%"
                                                    size="mini" @change="execmodechange($event, row)" :disabled="true">
                                                    <el-option key="1" label="实时执行" value="1"></el-option>
                                                    <el-option key="2" label="后台执行" value="2"></el-option>
                                                </el-select>
                                            </div>
                                        </template>
                                        <!-- <template v-slot:edit="{ row }">
                                            <el-select v-model="row.execmode" placeholder="" style="width: 100%" size="mini" @change="execmodechange($event, row)">
                                                <el-option key="1" label="实时执行" value="1"></el-option>
                                                <el-option key="2" label="后台执行" value="2"></el-option>
                                            </el-select>
                                        </template> -->
                                    </vxe-table-column>
                                    <vxe-table-column key="inter_type" field="inter_type" title="多步SQL" width="100px">
                                        <template v-slot="{ row, rowIndex, columnIndex }">
                                            <div :key="row.userno + rowIndex + columnIndex"
                                                v-if="row.inter_type == '3' || row.inter_type == '4' || row.inter_type == '5'">
                                                <div v-if="row.sqlnum == '0'">
                                                    <el-button type="info"
                                                        @click="jkffmx_methodsql_clickEvent(row)">多步SQL</el-button>
                                                </div>
                                                <div v-else>
                                                    <el-button type="success"
                                                        @click="jkffmx_methodsql_clickEvent(row)">多步SQL</el-button>
                                                </div>
                                            </div>
                                            <div :key="row.userno + rowIndex + columnIndex" v-else></div>
                                        </template>
                                    </vxe-table-column>
                                    <vxe-table-column key="method_data" field="method_data" title="方法配置"
                                        :edit-render="{ name: 'input' }" width="200px">
                                        <template v-slot:edit="{ row, rowIndex }">
                                            <el-input placeholder="" v-model="row.method_data" readonly
                                                @dblclick.native="tab_jkffmx_methoddata_clickEvent(row, rowIndex)"
                                                style="width: 178px"> </el-input>
                                        </template>
                                    </vxe-table-column>
                                    <vxe-table-column key="description" field="description" title="备注"
                                        :edit-render="{ name: 'input' }" width="120px">
                                        <template v-slot:edit="{ row }">
                                            <el-input placeholder="" v-model="row.description" style="width: 100%"
                                                @change="HasChange"> </el-input>
                                        </template>
                                    </vxe-table-column>
                                </vxe-table>
                                <div class="table-bottom" style="background-color: white">
                                    <table style="width: 60%; margin-left: 100px">
                                        <tr>
                                            <td style="text-align: right">
                                                <el-button icon="el-icon-plus"
                                                    @click="btn_addmethod_clickEvent">新增明细</el-button>
                                            </td>
                                            <td style="text-align: right">
                                                <el-button icon="el-icon-delete"
                                                    @click="btn_delmethod_clickEvent">删除明细</el-button>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </el-tab-pane>
                            <el-tab-pane label="接口特殊选项" name="tabname_jktxxx">
                                <vxe-table :data.sync="tab_jktxxx_data" :loading="tab_jktxxx_Loading"
                                    :checkbox-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border
                                    height="auto" highlight-current-row highlight-hover-column highlight-hover-row
                                    how-header-overflow ref="tab_jktxxx_table" resizable show-overflow size="mini" stripe
                                    show-header-overflow :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }"
                                    :edit-rules="tab_jktxxx_validRules" header-align="center">
                                    <vxe-table-column  type="selection"  width="40" align="center"></vxe-table-column>
                                    <vxe-table-column key="optioncode" field="optioncode" title="选项代码"
                                        width="150px"></vxe-table-column>
                                    <!-- <vxe-table-column key="optionvalue" field="optionvalue" title="选项取值" :edit-render="{ name: 'input', events: { change: HasChange } }" width="150px"></vxe-table-column> -->

                                    <vxe-table-column key="optionvalue" field="optionvalue" title="选项取值"
                                        :edit-render="{ name: 'input' }" width="200px">
                                        <template v-slot:edit="{ row, rowIndex }">
                                            <el-input placeholder="" v-model="row.optionvalue" readonly
                                                @dblclick.native="tab_jktxxx_optionvalue_clickEvent(row, rowIndex)"
                                                style="width: 178px"> </el-input>
                                        </template>
                                    </vxe-table-column>

                                    <vxe-table-column key="optionname" field="optionname" title="选项说明"
                                        width="150px"></vxe-table-column>
                                    <vxe-table-column key="valuekind" field="valuekind" title="取值类型" width="120px">
                                        <template v-slot="{ row }">
                                            <el-select v-model="row.valuekind" placeholder="请选择" style="width: 100%"
                                                @change="HasChange">
                                                <el-option key="DEPT" label="科室" value="DEPT"></el-option>
                                                <el-option key="WARD" label="病区" value="WARD"></el-option>
                                                <el-option key="PATTYPE" label="病人类型" value="PATTYPE"></el-option>
                                                <el-option key="USER" label="用户" value="USER"></el-option>
                                                <el-option key="FEETYPE" label="收费类型" value="FEETYPE"></el-option>
                                                <el-option key="USER1" label="hiscode1" value="USER1"></el-option>
                                                <el-option key="USER2" label="hiscode2" value="USER2"></el-option>
                                            </el-select>
                                        </template>
                                    </vxe-table-column>
                                </vxe-table>
                            </el-tab-pane>
                        </el-tabs>
                    </div>
                </template>
            </rm-layout-right>
        </div>
        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false"
            :title="main_hisinterface_dialog_name" :visible.sync="main_hisinterface_dialogflag"
            @close="main_hisinterface_dialogcloseEvent" width="630px">
            <div>
                <table>
                    <tr>
                        <td align="center">
                            <font color="#F56C6C">接口编码</font>
                        </td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.his_code"></el-input>
                        </td>
                        <td>
                            <font color="#F56C6C">接口名称</font>
                        </td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.his_name"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <font color="#F56C6C">医院编号</font>
                        </td>
                        <td colspan="2">
                            <rm-ddl-common datatype="hospital" dataname="医院" v-model="his_interface_info_F.hospcode"
                                width="190px" :disabled="canchangehosp"></rm-ddl-common>
                        </td>
                        <td>
                            <font color="#F56C6C">序号</font>
                        </td>
                        <td>
                            <el-input style="width: 50px" v-model="his_interface_info_F.his_seq"></el-input>
                        </td>
                        <td>
                            线程
                            <!-- <el-checkbox v-model="his_interface_info_F.servicethread">是否后台独立线程</el-checkbox> -->
                            <el-select v-model="his_interface_info_F.servicethread" style="width:100px">
                                <el-option v-for="(item, index) in servicethreadOption" :label="item.label"
                                    :value="item.value" :key="index"></el-option>
                            </el-select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <font color="#F56C6C">*</font>
                        </td>
                        <td colspan="2">
                            <el-checkbox v-model="his_interface_info_F.inuse" disabled>是否启用</el-checkbox>
                        </td>
                        <td>
                            <font color="#F56C6C">*</font>
                        </td>
                        <td colspan="2" style="width: 190px">
                            <el-checkbox v-model="his_interface_info_F.isdebug">是否调试状态</el-checkbox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <font color="#F56C6C">接口类型</font>
                        </td>
                        <td colspan="2">
                            <el-select v-model="his_interface_info_F.interfacetype" placeholder="请选择" style="width: 190px"
                                @change="TypeChange">
                                <el-option key="SQL" label="内置标准SQL配置" value="SQL"></el-option>
                                <el-option key="WEB" label="标准WebService配置" value="WEB"></el-option>
                                <el-option key="DEV" label="自定义接口对象" value="DEV"></el-option>
                            </el-select>
                        </td>
                        <td>数据库类型</td>
                        <td colspan="2">
                            <el-select v-model="his_interface_info_F.dbms" placeholder="请选择" style="width: 190px"
                                @change="DBChange">
                                <el-option key="ODBC" label="ODBC" value="ODBC"></el-option>
                                <el-option key="SQL" label="SQL" value="SQL"></el-option>
                                <el-option key="ORACLE" label="ORACLE" value="ORACLE"></el-option>
                                <el-option key="MYSQL" label="MYSQL" value="MYSQL"></el-option>
                            </el-select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <font>自定义对象名</font>
                        </td>
                        <td colspan="5">
                            <el-input style="width: 100%" v-model="his_interface_info_F.devclassname"
                                @dblclick.native="readonlyflagf ? QueryHisInter() : ''"
                                :placeholder="readonlyflagf ? '请选择自定义对象' : ''" :readonly="readonlyflagf"
                                :disabled="disabledflagf">
                                <i class="el-input__icon el-icon-menu" slot="suffix" @click="QueryHisInter()"
                                    v-show="readonlyflagf"></i>
                            </el-input>
                        </td>
                    </tr>
                    <tr>
                        <td>服务器名称或IP</td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.servername"></el-input>
                        </td>
                        <td>数据库名称</td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.dbname"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <font>WebService地址</font>
                        </td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.webinterurl"
                                :disabled="disabledflagf"></el-input>
                        </td>
                        <td>其他连接参数</td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.dbparm"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td>登录帐户</td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.logid"></el-input>
                        </td>
                        <td>帐户密码</td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.logpass"
                                type="password"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td>超级用户账号</td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.superlogid"></el-input>
                        </td>
                        <td>超级用户密码</td>
                        <td colspan="2">
                            <el-input style="width: 190px" v-model="his_interface_info_F.superlogpass"
                                type="password"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td>处理条码前缀</td>
                        <td colspan="5">
                            <el-input style="width: 100%" v-model="his_interface_info_F.barcodeheads"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td>处理条码长度</td>
                        <td colspan="2">
                            <el-input style="width: 100%" v-model="his_interface_info_F.barcodelens"></el-input>
                        </td>
                        <td></td>
                        <td colspan="2">
                            <el-checkbox v-model="his_interface_info_F.nobarcodeundo">无条码不执行本接口</el-checkbox>
                        </td>
                    </tr>
                    <tr>
                        <td>延时处理时间(分)</td>
                        <td colspan="5">
                            <el-input style="width: 100%" v-model="his_interface_info_F.delayprocess"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <div style="margin-top: 5px; text-align: right">
                                <el-button icon="el-icon-document" @click="
                                    SaveAction(1)
                                        .then(() => {
                                            main_data_query();
                                            $message({ message: '保存成功', type: 'success' });
                                        })
                                        .catch((res) => {
                                            $message.error(res.msg);
                                        })
                                    ">保存</el-button>
                                <el-button icon="el-icon-document-delete"
                                    @click="btn_hisinterface_dialog_canelEvent">取消</el-button>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </el-dialog>
        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="dialog_method_name"
            :visible.sync="main_description_dialogflag" width="740px">
            <div>
                <el-input type="textarea" style="width: 690px" height="200px" placeholder="请输入内容"
                    v-model="dialog_method_data" :autosize="{ minRows: 10, maxRows: 10 }"> </el-input>
            </div>
            <div>
                <el-input type="textarea" style="width: 690px" height="200px" placeholder="请输入内容"
                    v-model="dialog_method_description" :autosize="{ minRows: 12, maxRows: 12 }" disabled> </el-input>
            </div>
            <div style="margin-top: 5px; text-align: right; margin-right: 10px">
                <el-button icon="el-icon-document" @click="btn_description_dialog_saveEvent">确定</el-button>
                <el-button icon="el-icon-document-delete" @click="btn_description_dialog_canelEvent">取消</el-button>
            </div>
        </el-dialog>

        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="dialog_option_name"
            :visible.sync="main_option_dialogflag" width="740px">
            <div>
                <el-input type="textarea" style="width: 690px" height="200px" placeholder="请输入内容"
                    v-model="dialog_option_data" :autosize="{ minRows: 10, maxRows: 10 }"> </el-input>
            </div>
            <!-- <div>
                <el-input type="textarea" style="width: 690px" height="200px" placeholder="请输入内容" v-model="dialog_method_description" :autosize="{ minRows: 12, maxRows: 12 }" disabled> </el-input>
            </div> -->
            <div style="margin-top: 5px; text-align: right; margin-right: 10px">
                <el-button icon="el-icon-document" @click="btn_option_dialog_saveEvent">确定</el-button>
                <el-button icon="el-icon-document-delete" @click="btn_option_dialog_canelEvent">取消</el-button>
            </div>
        </el-dialog>

        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="dialog_method_name"
            :visible.sync="methodsql_dialogflag" width="740px">
            <div style="margin-bottom: 5px; text-align: right; margin-right: 10px">
                <el-button icon="el-icon-plus" @click="dialog_methodsql_addEvent">新增</el-button>
                <el-button icon="el-icon-edit" @click="dialog_methodsql_editEvent">修改</el-button>
                <el-button icon="el-icon-delete" @click="dialog_methodsql_delEvent">删除</el-button>
                <el-button icon="el-icon-document" @click="dialog_methodsql_sureEvent">确定</el-button>
            </div>
            <div>
                <vxe-table :data.sync="dialog_methodsql_data" :loading="dialog_methodsql_Loading"
                    :checkbox-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="200px"
                    highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow
                    ref="add_methodsql_table" resizable show-overflow size="mini" stripe show-header-overflow>
                    <vxe-table-column field="seq" sortable title="序号" width="60" show-overflow></vxe-table-column>
                    <vxe-table-column field="islisdb" sortable title="是否在LIS数据库中执行" width="160" show-overflow
                        align="center">
                        <template v-slot="{ row, rowIndex, columnIndex }">
                            <div :key="row.userno + rowIndex + columnIndex" v-if="row.islisdb == '0'">
                                <el-checkbox disabled></el-checkbox>
                            </div>
                            <div :key="row.userno + rowIndex + columnIndex" v-else>
                                <el-checkbox checked disabled></el-checkbox>
                            </div>
                        </template>
                    </vxe-table-column>
                    <vxe-table-column field="method_data" title="方法配置" width="440px" sortable></vxe-table-column>
                    <vxe-table-column field="description" sortable title="备注" width="100" show-overflow></vxe-table-column>
                </vxe-table>
            </div>
            <div>
                <el-input type="textarea" style="width: 700px; margin-top: 2px" height="200px" placeholder="请输入内容"
                    v-model="dialog_methodsql_description" :autosize="{ minRows: 12, maxRows: 12 }" disabled> </el-input>
            </div>
        </el-dialog>
        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="add_methodsql_name"
            :visible.sync="add_methodsql_dialogflag" width="740px" @close="add_methodsql_closeEvent">
            <div>
                <font color="#F56C6C">序号</font>&nbsp;
                <el-input style="width: 80px" v-model="add_methodsql_dialog_info.seq"></el-input>
                &nbsp;&nbsp;
                <el-checkbox v-model="add_methodsql_dialog_info.islisdb"> 是否在LIS数据库中执行</el-checkbox>
                &nbsp;&nbsp;
                <font>备注</font>&nbsp;
                <el-input style="width: 357px" v-model="add_methodsql_dialog_info.description"></el-input>
            </div>
            <div>
                <el-input type="textarea" style="width: 690px; margin-top: 5px" height="200px" placeholder="请输入内容"
                    v-model="add_methodsql_dialog_info.method_data" :autosize="{ minRows: 10, maxRows: 10 }"> </el-input>
            </div>
            <div style="margin-top: 5px; text-align: right; margin-right: 10px">
                <el-button icon="el-icon-document" @click="add_methodsql_saveEvent">保存</el-button>
                <el-button icon="el-icon-document-delete" @click="add_methodsql_closeEvent">取消</el-button>
            </div>
        </el-dialog>

        <el-dialog title="提示" :visible.sync="msgdialog" width="50%" style="overflow: hidden !important">
            <div style="height: 300px; overflow-y: scroll">
                <div v-html="showmsg"></div>
            </div>
            <div style="text-align: center">
                <span slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="btn_servicestatus_clickEvent">刷 新</el-button>
                    <el-button @click="msgdialog = false">取 消</el-button>
                </span>
            </div>
        </el-dialog>

        <el-dialog title="测试连接失败" :visible.sync="testconndialog" width="30%">
            <div v-html="showmsg"></div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="testconndialog = false">确 定</el-button>
            </span>
        </el-dialog>

        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="接口方法"
            :visible.sync="dialogTableVisible" v-if="dialogTableVisible" ref="popcommondialog">
            <rm-pop-common @cancel="dialogTableVisible = false" :datatype="popdatatype" @change="popchange"></rm-pop-common>
        </el-dialog>

        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="HIS接口对象"
            :visible.sync="dialogHisVisible" v-if="dialogHisVisible">
            <el-container style="height: 450px; border: 1px solid #eee">
                <el-main style="overflow: hidden">
                    <el-input @input="autosearch" @keydown.native="searchkeydown" placeholder="快速检索"
                        prefix-icon="el-icon-search" ref="qcodeinput" style="width: 300px" v-model="qcode"></el-input>
                    <el-button @click="hissubmit" icon="el-icon-circle-check" style="margin-left: 10px"
                        type="primary">确定</el-button>
                    <el-button @click="dialogHisVisible = false" icon="el-icon-circle-close" type="primary">取消</el-button>
                    <el-button style="float: right" @click="QueryHisInter()" icon="el-icon-refresh"
                        type="primary">刷新数据</el-button>
                    <vxe-table :data.sync="tablehisdatasearch" :loading="tablehisloading"
                        :checkbox-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" @cell-dblclick="tablehisdbl"
                        border height="auto" highlight-current-row highlight-hover-column highlight-hover-row
                        how-header-overflow show-overflow size="mini" stripe show-header-overflow resizable ref="tablehis"
                        header-align="center">
                        <vxe-table-column field="Name" title="接口名称" width="235px" sortable></vxe-table-column>
                        <vxe-table-column field="ClassName" title="接口对象名" width="177px" sortable></vxe-table-column>
                        <vxe-table-column field="Developer" title="开发者" width="55px" sortable
                            align="center"></vxe-table-column>
                        <vxe-table-column field="Tester" title="测试者" width="55px" sortable
                            align="center"></vxe-table-column>
                        <vxe-table-column field="DevDate" title="开发时间" width="120px" sortable
                            align="center"></vxe-table-column>
                        <vxe-table-column field="Version" title="接口版本" width="55px" sortable></vxe-table-column>
                        <vxe-table-column field="MachineName" title="计算机名" width="90px" sortable></vxe-table-column>
                        <vxe-table-column field="Guid" title="接口编号" width="90px" sortable></vxe-table-column>
                        <vxe-table-column field="ReadMe" title="接口说明" width="90px" sortable></vxe-table-column>
                    </vxe-table>
                </el-main>
            </el-container>
        </el-dialog>

        <el-dialog title="无条码不执行" :visible.sync="nobarcodeundoVisible" width="500px" :close-on-click-modal="false"
            ref="refnobarcodeundo" :show-close="false">
            <div style="color:#f70f0f;font-size:18px;text-indent:2em;margin:5px">
                此选项会导致没有条码号的数据都不执行本接口，请联系接口开发工程师，根据实际情况慎重勾选！<br>确需勾选，请输入密码：</div>
            <div>
                <el-input v-model="nobarcodeundoPwd" ref="RefnobarcodeundoPwd"></el-input>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="nobarcodeundo_click(1)">确 定</el-button>
                <el-button @click="nobarcodeundo_click(0)">取 消</el-button>
            </span>
        </el-dialog>

        <el-dialog title="线程修改" :visible.sync="servicethreadVisible" width="500px" :close-on-click-modal="false"
            ref="refnobarcodeundo" :show-close="false">
            <div style="color:#f70f0f;font-size:18px;text-indent:2em;margin:5px">
                修改本选项必须重启网站，否则将导致后台停止运行，修改后请务必重启网站!<br>请输入密码：</div>
            <div>
                <el-input v-model="servicethreadPwd" ref="RefservicethreadPwd"></el-input>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="servicethread_click(1)">确 定</el-button>
                <el-button @click="servicethread_click(0)">取 消</el-button>
            </span>
        </el-dialog>
        <!--自定义his接口开发说明-->
        <el-dialog title="自定义对象接口说明" :visible.sync="dialoginterfacedesc" width="50%" :close-on-click-modal="false">
            <div style="width:100%;height:580px;overflow:auto;border:3px double #ccc;padding:10px">
                {{ devinterfacedesc }}
            </div>
        </el-dialog>
    </div>
</template>


<script>
import { Promise } from "q";
import { invalid } from "moment";
import XE from "xe-utils"; //引入工具类
export default {
    name: "MNG141",
    data() {
        return {
            pageinitloading: false,
            canchangehosp: true,
            buttonwidth: "",
            qcodetable: "",
            selhospcode: "",
            main_his_interface_data: [],
            main_his_interface_data_all: [],
            msgdialog: false,
            testconndialog: false,
            showmsg: "",
            main_his_interface_loading: false,
            tab_showflag: "tabname_jbxx",
            main_hisinterface_dialog_name: "添加",
            main_hisinterface_dialogflag: false,
            his_interface_info_F: {},
            his_interface_info_B: {},
            oldhis_interface_info_B: {},
            disabledflagb: false,
            readonlyflagb: false,
            disabledflagf: false,
            readonlyflagf: false,
            his_interface_dialog_hiscodedisable: false,
            tab_jkffmx_data: [],
            tab_jkffmx_loading: false,
            tab_jkffmx_validRules: {
                method_code: [{ required: true, message: "必须填写" }],
                method_name: [{ required: true, message: "必须填写" }],
            },
            tab_jkffmx_select_method: [],
            main_description_dialogflag: false,
            main_option_dialogflag: false,
            dialog_method_row: "",
            dialog_option_row: "",
            dialog_method_description: "",
            dialog_method_data: "",
            dialog_option_data: "",
            dialog_method_name: "",
            dialog_option_name: "",
            tab_jktxxx_data: [],
            tab_jktxxx_Loading: false,
            tab_jktxxx_validRules: {
                optioncode: [{ required: true, message: "必须填写" }],
            },
            methodsql_dialogflag: false,
            methodsql_row: "",
            dialog_methodsql_description: "",
            dialog_methodsql_data: [],
            dialog_methodsql_Loading: false,
            add_methodsql_dialogflag: false,
            add_methodsql_name: "添加",
            add_methodsql_dialog_info: {
                his_code: "",
                method_code: "",
                method_data: "",
                seq: "",
                islisdb: false,
                description: "",
            },
            dialogTableVisible: false,
            popdatatype: "",
            tempItem: {},
            tabindexlist: [],
            tabindex: "1",

            changeflag: false,
            buttontxt: "启用",
            //自定义对象开窗
            tablehisdata: [],
            tablehisdatasearch: [],
            dialogHisVisible: false,
            tablehisloading: false,
            qcode: "",
            isAreaMode: false,
            currentHospName: "",
            servicethreadOption: [
                { label: "非独立线程", value: "0" },
                { label: "独立1线程", value: "1" },
                { label: "独立2线程", value: "2" },
                { label: "独立3线程", value: "3" },
                { label: "独立4线程", value: "4" },
                { label: "独立5线程", value: "5" },
                { label: "独立6线程", value: "6" },
                { label: "独立7线程", value: "7" },
                { label: "独立8线程", value: "8" },
                { label: "独立9线程", value: "9" },
                { label: "独立10线程", value: "10" },
            ],
            nobarcodeundoVisible: false,
            nobarcodeundoPwd: "",
            servicethreadVisible: false,
            servicethreadPwd: "",
            dialoginterfacedesc: false,
            devinterfacedesc: "",
        };
    },
    created() {
        this.getButtonWidth();
        this.main_data_query();
        this.get_tab_jkffmx_select_method();
    },
    mounted() { },
    updated() {
        this.getButtonWidth();
    },
    methods: {
        getButtonWidth() {
            if (this.$refs.buttondiv) {
                this.buttonwidth = this.$refs.buttondiv.offsetWidth + "px";
            }
            // this.canchangehosp = this.$tool.getSession(this.$tool.loginutype) != "G";
        },
        async main_data_query() {
            this.main_his_interface_loading = true;
            let _this = this;
            try {
                const res = await this.$tool.request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "his_interface_query",
                    },
                });
                var Datas = [];
                this.currentHospName = res.currentHospName;
                if (res.Data.length > 0) {
                    Datas = res.Data.sort((a, b) => b.inuse - a.inuse);
                    XE.each(Datas, (item, key) => {
                        if (item.isdebug == "1") {
                            item.isdebug = true;
                        } else {
                            item.isdebug = false;
                        }
                        if (item.inuse == "1") {
                            item.inuse = true;
                        } else {
                            item.inuse = false;
                        }
                        //checkbox为下拉框
                        // if (item.servicethread == "1") {
                        //     item.servicethread = true;
                        // } else {
                        //     item.servicethread = false;
                        // }
                        if (item.nobarcodeundo == "1") {
                            item.nobarcodeundo = true;
                        } else {
                            item.nobarcodeundo = false;
                        }
                    });
                    if (JSON.stringify(this.his_interface_info_B) != "{}" && Datas.filter((item) => item.his_code == this.his_interface_info_B.his_code).length > 0) {
                        this.$refs.his_interface_table.setCurrentRow(Datas.filter((item) => item.his_code == this.his_interface_info_B.his_code)[0]);
                        this.his_interface_info_B = XE.clone(Datas.filter((item) => item.his_code == this.his_interface_info_B.his_code)[0], true);
                        this.oldhis_interface_info_B = XE.clone(Datas.filter((item) => item.his_code == this.his_interface_info_B.his_code)[0], true);
                        this.tabchange(this.tabindex, this.his_interface_info_B.his_code);
                        switch (this.his_interface_info_B.interfacetype) {
                            case "SQL":
                                this.disabledflagb = true;
                                this.readonlyflagb = false;
                                break;
                            case "WEB":
                                this.disabledflagb = false;
                                this.readonlyflagb = false;
                                break;
                            case "DEV":
                                this.disabledflagb = false;
                                this.readonlyflagb = true;
                                break;
                        }
                    } else {
                        this.$refs.his_interface_table.setCurrentRow(Datas[0]);
                        this.his_interface_info_B = XE.clone(Datas[0], true);
                        this.oldhis_interface_info_B = XE.clone(Datas[0], true);
                        this.tabchange(this.tabindex, this.his_interface_info_B.his_code);
                        switch (this.his_interface_info_B.interfacetype) {
                            case "SQL":
                                this.disabledflagb = true;
                                this.readonlyflagb = false;
                                break;
                            case "WEB":
                                this.disabledflagb = false;
                                this.readonlyflagb = false;
                                break;
                            case "DEV":
                                this.disabledflagb = false;
                                this.readonlyflagb = true;
                                break;
                        }
                    }
                    this.main_his_interface_data_all = Datas;
                    // var qcode = this.qcodetable.toUpperCase();
                    // this.main_his_interface_data = this.main_his_interface_data_all.filter((item) => item.his_code.toUpperCase().indexOf(qcode) > -1 || item.his_name.toUpperCase().indexOf(qcode) > -1 || item.hospitalname.toUpperCase().indexOf(qcode) > -1 || item.dbname.toUpperCase().indexOf(qcode) > -1);
                    this.QueryHisTable(this.selhospcode);
                    this.$nextTick(() => {
                        if (this.main_his_interface_data.filter((item) => item.his_code == this.his_interface_info_B.his_code).length == 0) {
                            var row = this.$refs.his_interface_table.getData(0);
                            this.his_interface_info_B = XE.clone(row, true);
                            this.$refs.his_interface_table.setCurrentRow(row);
                        }
                    });
                }
                //this.main_his_interface_data = Datas;

                this.main_his_interface_loading = false;
                this.changeflag = false;
            } catch (e) {
                this.main_his_interface_loading = false;
                this.$message.error(e);
            }
        },
        QueryHisTable(val) {
            var qcode = this.qcodetable.toUpperCase();
            this.main_his_interface_data = XE.clone(
                this.main_his_interface_data_all.filter((item) => item.his_code.toUpperCase().indexOf(qcode) > -1 || item.his_name.toUpperCase().indexOf(qcode) > -1 || item.hospitalname.toUpperCase().indexOf(qcode) > -1 || item.dbname.toUpperCase().indexOf(qcode) > -1),
                true
            );
            if (val)
                this.main_his_interface_data = XE.clone(
                    this.main_his_interface_data.filter((item) => item.hospcode == val),
                    true
                );
            this.$nextTick(() => {
                if (this.main_his_interface_data.length > 0) {
                    if (this.main_his_interface_data.filter((item) => item.his_code == this.his_interface_info_B.his_code).length == 0) {
                        var row = this.$refs.his_interface_table.getData(0);
                        this.his_interface_info_B = XE.clone(row, true);
                        this.$refs.his_interface_table.setCurrentRow(row);
                        switch (this.his_interface_info_B.interfacetype) {
                            case "SQL":
                                this.disabledflagb = true;
                                this.readonlyflagb = false;
                                break;
                            case "WEB":
                                this.disabledflagb = false;
                                this.readonlyflagb = false;
                                break;
                            case "DEV":
                                this.disabledflagb = false;
                                this.readonlyflagb = true;
                                break;
                        }
                    } else {
                        this.$refs.his_interface_table.setCurrentRow(this.main_his_interface_data.find((item) => item.his_code == this.his_interface_info_B.his_code));
                    }
                }
            });
        },
        QueryHisTableHosp(val) { },
        his_interface_table_changeEvent({ row, rowIndex, column, columnIndex }, event) {
            // this.SaveAction(2)
            //     .then(() => {
            console.log("row", row);
            this.his_interface_info_B = XE.clone(row, true);
            if (this.isAreaMode) {
                this.canchangehosp = false;
            } else {
                this.canchangehosp = true;
            }

            this.oldhis_interface_info_B = XE.clone(row, true);
            this.TypeChange(row.interfacetype);
            this.changeflag = false;
            this.main_data_query();
            this.tabchange(this.tabindex, row.his_code);
            // })
            // .catch((res) => {
            //     console.log("err", res);
            //     this.$confirm(res.msg, "错误", {
            //         confirmButtonText: "确定",
            //         type: "warning",
            //     });
            //     var row = this.main_his_interface_data.filter((item) => item.his_code == res.hiscode)[0];
            //     this.$refs.his_interface_table.setCurrentRow(row);
            //     this.tabchange(this.tabindex, row.his_code);
            // });

            //this.tab_jkffmx_getdata(row.his_code);
            //this.tab_jktxxx_getdata(row.his_code);
        },
        get_tab_jkffmx_select_method() {
            let _this = this;
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "get_his_method",
                    },
                })
                .then((res) => {
                    _this.tab_jkffmx_select_method = res.data;
                    if (res.isAreaMode) {
                        this.isAreaMode = true;
                        this.canchangehosp = false;
                    } else {
                        this.isAreaMode = false;
                        this.canchangehosp = true;
                    }
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },
        btn_addhisinterface_clickEvent() {
            this.his_interface_info_F = { hospcode: this.$tool.getSession(this.$tool.selectedhis), inuse: false, isdebug: false, servicethread: "0", interfacetype: "SQL", servername: "IP地址,端口号", dbname: "", his_seq: "", his_code: "", his_name: "", dbms: "", devclassname: "", webinterurl: "", dbparm: "", logid: "", logpass: "", barcodeheads: "", barcodelens: "", nobarcodeundo: false, delayprocess: "", superlogid: "", superlogpass: "" };

            if (!this.isAreaMode) {
                this.his_interface_info_F.hospcode = "All";
            }
            this.his_interface_dialog_hiscodedisable = true;
            this.main_hisinterface_dialog_name = "添加";
            this.main_hisinterface_dialogflag = true;
            this.disabledflagf = true;
            this.readonlyflagf = false;
            this.his_interface_info_F.dbms = "";
        },
        btn_delhisinterface_clickEvent() {
            if (XE.isUndefined(this.his_interface_info_B.his_code) || this.his_interface_info_B.his_code == "") {
                this.$message.error("请选择需要删除的数据！");
                return false;
            }
            let _this = this;
            this.$confirm("此操作将永久删除<span style='color:red;font-weight:bold'>整个</span>接口<span style='color:red;font-weight:bold'>" + this.$refs.his_interface_table.getCurrentRow().his_name + "</span>, <br/><span style='color:red;font-weight:bold'>请慎重慎重再慎重，重要的问题说三遍！</span><br/><span style='color:red;font-weight:bold'>请慎重慎重再慎重，重要的问题说三遍！</span><br/><span style='color:red;font-weight:bold'>请慎重慎重再慎重，重要的问题说三遍！</span><br/>是否继续?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                dangerouslyUseHTMLString: true,
                type: "warning",
            })
                .then(() => {
                    this.$tool
                        .request({
                            url: "MNG/MNG1/MNG141",
                            method: "post",
                            data: {
                                action: "his_interface_delete",
                                hiscode: _this.his_interface_info_B.his_code,
                            },
                        })
                        .then((res) => {
                            if (res == "1") {
                                _this.$message({
                                    message: "删除成功！",
                                    type: "success",
                                });
                                //刷新
                                //_this.his_interface_info_B = { hospcode: "All", inuse: true, isdebug: false };
                                _this.main_data_query();
                            } else {
                                _this.$message.error(res);
                            }
                        })
                        .catch((e) => {
                            this.$message.error(e);
                        });
                })
                .catch(() => {
                    this.$message({
                        type: "info",
                        message: "已取消删除",
                    });
                });
        },
        //测试连接
        btn_testconnect_clickEvent() {
            return new Promise((s, f) => {
                if (XE.isUndefined(this.his_interface_info_B.his_code) || this.his_interface_info_B.his_code == "") {
                    this.$message.error("请选择需要测试的数据！");
                    f();
                }
                this.$tool
                    .request({
                        url: "MNG/MNG1/MNG141",
                        method: "post",
                        data: {
                            action: "lisinter_testconnect",
                            hiscode: this.his_interface_info_B.his_code,
                        },
                    })
                    .then((res) => {
                        if (res == "") {
                            this.$message.success("测试连接成功！");
                            s();
                        } else {
                            this.testconndialog = true;
                            this.showmsg = res;
                            f();
                        }
                    })
                    .catch((e) => {
                        this.$message.error(e);
                        f();
                    });
            });
        },
        //测试全部连接
        btn_testallconnect_clickEvent() {
            return new Promise((s, f) => {
                this.$tool
                    .request({
                        url: "MNG/MNG1/MNG141",
                        method: "post",
                        data: {
                            action: "lisinter_testallconnect",
                        },
                    })
                    .then((res) => {
                        if (res && res.errcode == 1) {
                            if (res.list.length == 0) {
                                this.$message.success("测试连接成功！");
                            } else {
                                this.showmsg = "";
                                for (let i = 0; i < res.list.length; i++) {
                                    this.showmsg += "<span style='color:red'>" + res.list[i].Item1 + "</span> " + res.list[i].Item2 + "\n";
                                }
                                this.testconndialog = true;
                                console.log("msg", this.showmsg);
                            }

                            s();
                        } else {
                            this.testconndialog = true;
                            this.showmsg = res.errmsg;
                            f();
                        }
                    })
                    .catch((e) => {
                        this.$message.error(e);
                        f();
                    });
            });
        },
        btn_servicestatus_clickEvent() {
            this.showmsg = "";
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "lisinter_servicestatus",
                    },
                })
                .then((res) => {
                    this.msgdialog = true;
                    this.showmsg = res;
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },
        SaveAll() {
            this.SaveAction(2).then(() => {
                this.$message({
                    message: "保存成功！",
                    type: "success",
                });
                this.main_data_query();
            });
        },
        SaveAction(type) {
            return Promise((s, f) => {
                this.pageinitloading = true;
                if (this.tabindexlist.indexOf("2") > -1) {
                    this.btn_savemethod_clickEvent()
                        .then(() => {
                            this.btn_hisinterface_dialog_saveEvent(type)
                                .then(() => {
                                    s();
                                    this.pageinitloading = false;
                                })
                                .catch((res) => {
                                    f(res);
                                    this.pageinitloading = false;
                                });
                        })
                        .catch(() => {
                            f();
                            this.pageinitloading = false;
                        });
                } else {
                    this.btn_hisinterface_dialog_saveEvent(type)
                        .then(() => {
                            s();
                            this.pageinitloading = false;
                        })
                        .catch((res) => {
                            f(res);
                            this.pageinitloading = false;
                        });
                }
                if (this.tabindexlist.indexOf("3") > -1) this.btn_saveinteroption_clickEvent();
            });
        },
        //自定义对象启用时测试接口是否能正常连接
        TestConnetBeforeInUse() {
            return new Promise((s, f) => {
                if (this.his_interface_info_B.interfacetype == "DEV" && this.his_interface_info_B.devclassname != "") {
                    this.$tool
                        .request({
                            url: "MNG/MNG1/MNG141",
                            method: "post",
                            data: {
                                action: "lisinter_test",
                                his_code: this.his_interface_info_B.his_code,
                            },
                        })
                        .then((res) => {
                            if (res.errcode <= 0) {
                                f();
                            } else {
                                s();
                            }
                        })
                        .catch((e) => {
                            f();
                            this.$message.error(e);
                        });
                } else {
                    s();
                }
            });
        },
        btn_hisinterface_dialog_saveEvent(type) {
            //TYPE=1新增 2修改
            return Promise((s, f) => {
                // console.log("his_interface_info_F", this.his_interface_info_F);
                // console.log("his_interface_info_B", this.his_interface_info_B);
                var gData = type == "1" ? this.his_interface_info_F : this.his_interface_info_B;
                var his_code = "";
                if (type == "1") his_code = this.his_interface_info_F.his_code;
                else his_code = this.oldhis_interface_info_B.his_code;
                if (JSON.stringify(this.oldhis_interface_info_B) != JSON.stringify(this.his_interface_info_B) || type) {
                    if (XE.isUndefined(gData.his_code) || gData.his_code === "") {
                        f({ hiscode: his_code, msg: "接口编码不可为空！" });
                        return false;
                    }
                    if (XE.isUndefined(gData.his_name) || gData.his_name === "") {
                        f({ hiscode: his_code, msg: "接口名称不可为空！" });
                        return false;
                    }
                    if (XE.isUndefined(gData.hospcode) || gData.hospcode === "") {
                        f({ hiscode: his_code, msg: "医院代码不可为空！" });
                        return false;
                    }
                    if (XE.isUndefined(gData.his_seq) || gData.his_seq === "") {
                        f({ hiscode: his_code, msg: "序号不可为空！" });
                        return false;
                    }
                    if (XE.isUndefined(gData.interfacetype) || gData.interfacetype === "") {
                        f({ hiscode: his_code, msg: "接口类型不可为空！" });
                        return false;
                    } else {
                        if (gData.interfacetype == "DEV") {
                            if (XE.isUndefined(gData.devclassname) || gData.devclassname === "") {
                                f({ hiscode: his_code, msg: "自定义对象名称不能为空！" });
                                return false;
                            }
                        }
                        if (gData.interfacetype == "WEB") {
                            if (XE.isUndefined(gData.devclassname) || gData.devclassname === "") {
                                f({ hiscode: his_code, msg: "自定义对象名称不能为空！" });
                                return false;
                            }
                            if (XE.isUndefined(gData.webinterurl) || gData.webinterurl === "") {
                                f({ hiscode: his_code, msg: "WebService地址不能为空！" });
                                return false;
                            }
                        }
                    }

                    gData.inuse = gData.inuse ? "1" : "0";
                    gData.isdebug = gData.isdebug ? "1" : "0";
                    //gData.servicethread = gData.servicethread ? "1" : "0";
                    gData.nobarcodeundo = gData.nobarcodeundo ? "1" : "0";
                    if (!this.isAreaMode && gData.hospcode != "All") {
                        this.$confirm("非区域LIS模式，是否将医院编号改为【全部医院】", "提示", {
                            confirmButtonText: "确定",
                            cancelButtonText: "取消",
                            dangerouslyUseHTMLString: true,
                            type: "warning",
                        })
                            .then(() => {
                                gData.hospcode = "All";
                                let datajson = JSON.stringify(gData); //将json对象转换成字
                                this.$tool
                                    .request({
                                        url: "MNG/MNG1/MNG141",
                                        method: "post",
                                        data: {
                                            action: "his_interface_addoredit",
                                            data: datajson,
                                            type: type,
                                            hiscode: his_code,
                                        },
                                    })
                                    .then((res) => {
                                        if (res == "1") {
                                            this.main_hisinterface_dialogflag = false;
                                            if (type == 1) {
                                                this.his_interface_info_B = XE.clone(this.his_interface_info_F, true);
                                                this.btn_interface_clickEvent();
                                            }
                                            s();
                                        } else {
                                            this.$message.error(res);
                                            f();
                                        }
                                    })
                                    .catch((e) => {
                                        this.$message.error(e);
                                        f();
                                    });
                                //saveData(datajson, type, his_code);
                            })
                            .catch(() => {
                                // this.$alert("取消了！！！！");
                                let datajson = JSON.stringify(gData); //将json对象转换成字
                                this.$tool
                                    .request({
                                        url: "MNG/MNG1/MNG141",
                                        method: "post",
                                        data: {
                                            action: "his_interface_addoredit",
                                            data: datajson,
                                            type: type,
                                            hiscode: his_code,
                                        },
                                    })
                                    .then((res) => {
                                        if (res == "1") {
                                            this.main_hisinterface_dialogflag = false;
                                            if (type == 1) {
                                                this.his_interface_info_B = XE.clone(this.his_interface_info_F, true);
                                                this.btn_interface_clickEvent();
                                            }
                                            s();
                                        } else {
                                            this.$message.error(res);
                                            f();
                                        }
                                    })
                                    .catch((e) => {
                                        this.$message.error(e);
                                        f();
                                    });
                            });
                    } else {
                        let datajson = JSON.stringify(gData);
                        this.$tool
                            .request({
                                url: "MNG/MNG1/MNG141",
                                method: "post",
                                data: {
                                    action: "his_interface_addoredit",
                                    data: datajson,
                                    type: type,
                                    hiscode: his_code,
                                },
                            })
                            .then((res) => {
                                if (res == "1") {
                                    this.main_hisinterface_dialogflag = false;
                                    if (type == 1) {
                                        this.his_interface_info_B = XE.clone(this.his_interface_info_F, true);
                                        this.btn_interface_clickEvent();
                                    }
                                    s();
                                } else {
                                    this.$message.error(res);
                                    f();
                                }
                            })
                            .catch((e) => {
                                this.$message.error(e);
                                f();
                            });
                    }

                    //转换checkbox
                } else {
                    s();
                }
            });
        },

        btn_hisinterface_dialog_canelEvent() {
            this.main_hisinterface_dialogflag = false;
        },
        main_hisinterface_dialogcloseEvent() { },
        tab_getdata(tab, event) {
            if (tab.label == "详细信息") {
                this.tabindex = "1";
                if (this.tabindexlist.indexOf("1") <= -1) this.tabindexlist.push("1");
            }
            if (tab.label == "接口方法明细") {
                this.tabindex = "2";
                if (this.tabindexlist.indexOf("2") <= -1) {
                    this.tabindexlist.push("2");
                    this.tab_jkffmx_getdata(this.his_interface_info_B.his_code);
                }
            }
            if (tab.label == "接口特殊选项") {
                this.tabindex = "3";
                if (this.tabindexlist.indexOf("3") <= -1) {
                    this.tabindexlist.push("3");
                    this.tab_jktxxx_getdata(this.his_interface_info_B.his_code);
                }
            }
        },
        HasChange(val) {
            this.changeflag = true;
        },
        TypeChange(val) {
            if (this.main_hisinterface_dialogflag) {
                switch (val) {
                    case "SQL":
                        this.disabledflagf = true;
                        this.readonlyflagf = false;
                        this.his_interface_info_F.devclassname = "";
                        this.his_interface_info_F.webinterurl = "";
                        break;
                    case "WEB":
                        this.disabledflagf = false;
                        this.readonlyflagf = false;
                        this.his_interface_info_F.devclassname = "";
                        this.his_interface_info_F.webinterurl = "";
                        break;
                    case "DEV":
                        this.disabledflagf = false;
                        this.readonlyflagf = true;
                        this.his_interface_info_F.devclassname = "";
                        this.his_interface_info_F.webinterurl = "";
                        break;
                }
            } else {
                this.changeflag = true;
                switch (val) {
                    case "SQL":
                        this.disabledflagb = true;
                        this.readonlyflagb = false;
                        this.his_interface_info_B.devclassname = "";
                        this.his_interface_info_B.webinterurl = "";
                        break;
                    case "WEB":
                        this.disabledflagb = false;
                        this.readonlyflagb = false;
                        this.his_interface_info_B.devclassname = "";
                        this.his_interface_info_B.webinterurl = "";
                        break;
                    case "DEV":
                        this.disabledflagb = false;
                        this.readonlyflagb = true;
                        this.his_interface_info_B.devclassname = "";
                        this.his_interface_info_B.webinterurl = "";
                        break;
                }
            }
        },
        tabchange(index, hiscode) {
            this.tabindexlist = [index];
            switch (index) {
                case "2":
                    this.tab_jkffmx_getdata(hiscode);
                    break;
                case "3":
                    this.tab_jktxxx_getdata(hiscode);
                    break;
            }
        },
        tab_jkffmx_getdata(hiscode) {
            this.tab_jkffmx_loading = true;
            let _this = this;
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "his_intermethod_query",
                        hiscode: hiscode,
                    },
                })
                .then((res) => {
                    XE.each(res.Data, (item, key) => {
                        if (item.inuse == "1") {
                            item.inuse = true;
                        } else {
                            item.inuse = false;
                        }
                    });
                    _this.tab_jkffmx_data = res.Data;
                    _this.tab_jkffmx_loading = false;
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },
        execmodechange(e, row) {
            if (e == 1) row.execmodename = "实时执行";
            else row.execmodename = "后台执行";
            this.changeflag = true;
        },
        popchange(c, n, row) {
            this.tempItem.sqlnum = "3";
            if (this.$refs.tab_jkffmx_table.tableFullData.filter((item) => item.method_code == c).length == 0) {
                this.tempItem.method_code = c;
                this.tempItem.method_name = n;
                this.GetSqlNum(this.tempItem.his_code, this.tempItem.method_code);
                // console.info("this.tempItem ==" + this.tempItem.inter_type);
                // if (this.tempItem.inter_type == "3") {
                //     this.tempItem.isAllowSelect = true;
                // } else {
                //     this.tempItem.isAllowSelect = false;
                // }
                this.dialogTableVisible = false;
                this.changeflag = true;
            } else {
                this.$confirm("接口方法重复!", "提示", {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning",
                });
            }
        },
        GetSqlNum(hiscode, methodcode) {
            //验证是否多步SQL  并且获取是否有历史SQL多步数据
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "get_sqlnum",
                        hiscode: hiscode,
                        methodcode: methodcode,
                    },
                })
                .then((res) => {
                    this.tempItem.inter_type = res[0];

                    this.tempItem.sqlnum = res[1];
                    if (this.tempItem.inter_type == "3" && methodcode != "REQDETAILSYNC_CHARGE" && methodcode != "REQDETAILSYNC_UNCHARGE") {
                        this.tempItem.isAllowSelect = true;
                    } else {
                        if (this.tempItem.inter_type == "4") {
                            this.tempItem.execmode = "1";
                            this.tempItem.execmodename = "实时执行";
                        } else if (this.tempItem.inter_type == "5") {
                            this.tempItem.execmode = "2";
                            this.tempItem.execmodename = "后台执行";
                        }
                        this.tempItem.isAllowSelect = false;
                    }
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },
        btn_addmethod_clickEvent() {
            if (XE.isUndefined(this.his_interface_info_B.his_code) || this.his_interface_info_B.his_code == "") {
                this.$message.error("请选择HIS接口！");
                return false;
            }
            let record = {
                his_code: this.his_interface_info_B.his_code,
                method_code: "",
                inuse: true,
                execmode: "1",
                method_data: "",
                description: "",
                isAllowSelect: false,
            };
            this.$refs.tab_jkffmx_table.insert(record).then(() => {
                // this.$refs.tab_jkffmx_table.setCurrentRow(this.$refs.tab_jkffmx_table.tableFullData[this.$refs.tab_jkffmx_table.tableFullData.length - 1]);
                this.$refs.tab_jkffmx_table.setCurrentRow(this.$refs.tab_jkffmx_table.tableFullData[0]);
                this.changeflag = true;
            });
        },
        btn_delmethod_clickEvent() {
            // let removeRecords = this.$refs.tab_jkffmx_table.getSelectRecords();
            // if (removeRecords.length <= 0) {
            //     this.$message.error("请勾选需要删除的明细！");
            //     return false;
            // }
            // this.$confirm("此操作将删除选中明细, 是否继续?", "提示", {
            //     confirmButtonText: "确定",
            //     cancelButtonText: "取消",
            //     type: "warning",
            // })
            //     .then(() => {
            //         this.$refs.tab_jkffmx_table.removeSelecteds();
            //         if (this.$refs.tab_jkffmx_table.getRemoveRecords().length > 0) this.changeflag = true;
            //         else if (this.changeflag) this.changeflag = true;
            //         else this.changeflag = false;
            //     })
            //     .catch(() => {});

            var delrow = this.$refs.tab_jkffmx_table.getCurrentRow();
            if (delrow) {
                this.$confirm("此操作将删除选中明细, 是否继续?", "提示", {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning",
                })
                    .then(() => {
                        var alld = this.$refs.tab_jkffmx_table.tableData;
                        var rowindex = alld.indexOf(delrow);
                        this.$refs.tab_jkffmx_table.remove(delrow);
                        //this.$refs.tab_jkffmx_table.removeSelecteds();
                        console.log(this.$refs.tab_jkffmx_table.getRemoveRecords())
                        if (this.$refs.tab_jkffmx_table.getRemoveRecords().length > 0) {
                            this.changeflag = true;
                        } 
                        else if (this.changeflag) {
                             this.changeflag = true; 
                            }
                        else { 
                            this.changeflag = false;
                         }
                    })
                    .catch(() => {

                    });
            }
        },
        btn_savemethod_clickEvent() {
            return new Promise((s, f) => {
                this.$refs.tab_jkffmx_table.validate(async (valid) => {
                    if (valid) {
                        let removeRecords = this.$refs.tab_jkffmx_table.getRemoveRecords();
                        let updateRecords = this.$refs.tab_jkffmx_table.getUpdateRecords();
                        let insertRecords = this.$refs.tab_jkffmx_table.getInsertRecords();
                        XE.each(removeRecords, (item, key) => {
                            if (item.inuse) {
                                item.inuse = "1";
                            } else {
                                item.inuse = "0";
                            }
                        });
                        XE.each(updateRecords, (item, key) => {
                            if (item.cdata.inuse) {
                                item.cdata.inuse = "1";
                            } else {
                                item.cdata.inuse = "0";
                            }
                        });
                        XE.each(insertRecords, (item, key) => {
                            if (item.inuse) {
                                item.inuse = "1";
                            } else {
                                item.inuse = "0";
                            }
                        });
                        let _this = this;
                        if (removeRecords.length > 0 || updateRecords.length > 0 || insertRecords.length > 0) {
                            var isupdate = false;
                            var strName = "";
                            if (updateRecords.length > 0) {
                                for (let index = 0; index < updateRecords.length; index++) {
                                    let data = updateRecords[index].cdata;
                                    if ((data.inter_type != "3" && data.execmode != "1") || (data.method_code == "REQDETAILSYNC_CHARGE" && data.execmode != "1") || (data.method_code == "REQDETAILSYNC_UNCHARGE" && data.execmode != "1")) {
                                        isupdate = true;
                                        strName += data.method_name + ",";
                                    }
                                }
                            }

                            try {
                                if (isupdate) {
                                    this.$confirm("接口方法【" + strName.substring(0, strName.length - 1) + "】的执行方式有误，是否进行更改？", "提示", {
                                        confirmButtonText: "确定",
                                        cancelButtonText: "取消",
                                        type: "warning",
                                    })
                                        .then(() => {
                                            for (let index = 0; index < updateRecords.length; index++) {
                                                let data = updateRecords[index].cdata;
                                                if ((data.inter_type != "3" && data.execmode != "1") || (data.method_code == "REQDETAILSYNC_CHARGE" && data.execmode != "1") || (data.method_code == "REQDETAILSYNC_UNCHARGE" && data.execmode != "1")) {
                                                    data.execmode = "1";
                                                }
                                            }
                                            this.$tool
                                                .request({
                                                    url: "MNG/MNG1/MNG141",
                                                    method: "post",
                                                    data: {
                                                        action: "save_his_intermethod",
                                                        removeRecords: removeRecords,
                                                        updateRecords: updateRecords,
                                                        insertRecords: insertRecords,
                                                    },
                                                })
                                                .then((res) => {
                                                    if (res == "1") {
                                                        this.btn_interface_clickEvent();
                                                        s();
                                                    } else {
                                                        this.$alert(res, "错误", {
                                                            confirmButtonText: "确定",
                                                        });
                                                        f();
                                                    }
                                                });
                                        })
                                        .catch(() => {
                                            this.$tool
                                                .request({
                                                    url: "MNG/MNG1/MNG141",
                                                    method: "post",
                                                    data: {
                                                        action: "save_his_intermethod",
                                                        removeRecords: removeRecords,
                                                        updateRecords: updateRecords,
                                                        insertRecords: insertRecords,
                                                    },
                                                })
                                                .then((res) => {
                                                    if (res == "1") {
                                                        this.btn_interface_clickEvent();
                                                        s();
                                                    } else {
                                                        this.$alert(res, "错误", {
                                                            confirmButtonText: "确定",
                                                        });
                                                        f();
                                                    }
                                                });
                                        });
                                } else {
                                    const res = await this.$tool
                                        .request({
                                            url: "MNG/MNG1/MNG141",
                                            method: "post",
                                            data: {
                                                action: "save_his_intermethod",
                                                removeRecords: removeRecords,
                                                updateRecords: updateRecords,
                                                insertRecords: insertRecords,
                                            },
                                        })
                                        .then((res) => {
                                            if (res == "1") {
                                                this.btn_interface_clickEvent();
                                                s();
                                            } else {
                                                this.$alert(res, "错误", {
                                                    confirmButtonText: "确定",
                                                });
                                                f();
                                            }
                                        });
                                }
                            } catch (e) {
                                this.$message.error(e);
                                f();
                            }
                        } else {
                            s();
                        }
                    } else {
                        this.$message.error("接口方法明细主键校验错误！");
                        f();
                    }
                });
            });
        },
        btn_description_dialog_saveEvent() {
            let index = XE.findIndexOf(this.tab_jkffmx_data, (item) => item.method_code == this.dialog_method_row.method_code);
            if (index >= 0) {
                this.tab_jkffmx_data[index].method_data = this.dialog_method_data;
                this.main_description_dialogflag = false;
                this.changeflag = true;
            } else {
                let insertRecords = this.$refs.tab_jkffmx_table.getInsertRecords();
                let addindex = XE.findIndexOf(insertRecords, (item) => item.method_code == this.dialog_method_row.method_code);
                if (addindex >= 0) {
                    insertRecords[addindex].method_data = this.dialog_method_data;
                    this.main_description_dialogflag = false;
                }
            }
        },
        btn_description_dialog_canelEvent() {
            this.main_description_dialogflag = false;
        },
        tab_jkffmx_methoddata_clickEvent(row, rowIndex) {
            if (XE.isUndefined(row.method_code) || row.method_code == "") {
                this.$message.error("请先选择方法！");
                return false;
            }

            let intermethod_index = XE.findIndexOf(this.tab_jkffmx_select_method, (item) => item.value == row.method_code);
            this.dialog_method_description = this.tab_jkffmx_select_method[intermethod_index].description;
            this.dialog_method_data = row.method_data;
            this.dialog_method_row = row;
            this.dialog_method_name = this.tab_jkffmx_select_method[intermethod_index].label + "[" + this.tab_jkffmx_select_method[intermethod_index].value + "]";
            this.main_description_dialogflag = true;
        },

        tab_jktxxx_optionvalue_clickEvent(row, rowIndex) {
            let index = XE.findIndexOf(this.tab_jktxxx_data, (item) => item.optioncode == row.optioncode);
            this.dialog_option_data = row.optionvalue;
            this.dialog_option_name = "[" + row.optioncode + "]_选项取值";
            this.dialog_option_row = row;
            this.main_option_dialogflag = true;
        },
        btn_option_dialog_saveEvent() {
            let index = XE.findIndexOf(this.tab_jktxxx_data, (item) => item.optioncode == this.dialog_option_row.optioncode);
            if (index >= 0) {
                this.tab_jktxxx_data[index].optionvalue = this.dialog_option_data;
                this.main_option_dialogflag = false;
                this.changeflag = true;
            } else {
            }
        },
        btn_option_dialog_canelEvent() {
            this.main_option_dialogflag = false;
        },

        jkffmx_methodsql_clickEvent(row) {
            if (XE.isUndefined(row.method_code) || row.method_code == "") {
                this.$message.error("请先选择方法！");
                return false;
            }
            let intermethod_index = XE.findIndexOf(this.tab_jkffmx_select_method, (item) => item.value == row.method_code);
            this.dialog_methodsql_description = this.tab_jkffmx_select_method[intermethod_index].description;
            this.methodsql_row = row;
            this.dialog_method_name = this.tab_jkffmx_select_method[intermethod_index].label + "[" + this.tab_jkffmx_select_method[intermethod_index].value + "]";
            this.get_intermethodsql(row.his_code, row.method_code);
            this.methodsql_dialogflag = true;
        },
        get_intermethodsql(his_code, method_code) {
            this.dialog_methodsql_Loading = true;
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "get_methodsql",
                        hiscode: his_code,
                        methodcode: method_code,
                    },
                })
                .then((res) => {
                    this.dialog_methodsql_data = res.Data;
                    this.dialog_methodsql_Loading = false;
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },
        init_add_methodsql_dialog_info() {
            this.add_methodsql_dialog_info.his_code = this.methodsql_row.his_code;
            this.add_methodsql_dialog_info.method_code = this.methodsql_row.method_code;
            this.add_methodsql_dialog_info.seq = "";
            this.add_methodsql_dialog_info.islisdb = false;
            this.add_methodsql_dialog_info.method_data = "";
            this.add_methodsql_dialog_info.description = "";
        },
        dialog_methodsql_addEvent() {
            this.init_add_methodsql_dialog_info();
            this.add_methodsql_name = "添加";
            this.add_methodsql_dialogflag = true;
        },
        dialog_methodsql_editEvent() {
            let row = this.$refs.add_methodsql_table.getCurrentRow();
            if (XE.isNull(row)) {
                this.$message.error("请先选择数据！");
                return false;
            }
            this.add_methodsql_dialog_info = XE.clone(row, true);
            this.add_methodsql_dialog_info.islisdb = this.add_methodsql_dialog_info.islisdb == "1" ? true : false;
            this.add_methodsql_name = "修改";
            this.add_methodsql_dialogflag = true;
        },
        dialog_methodsql_delEvent() {
            let row = this.$refs.add_methodsql_table.getCurrentRow();
            if (XE.isNull(row)) {
                this.$message.error("请先选择数据！");
                return false;
            }
            this.$rmConfirm({
                type: "提示",
                msg: "删除操作请慎重考虑, 是否继续？",
                btn: {
                    confirmBtnText: "确定",
                    cancelBtnText: "取消",
                },
            })
                .then(() => {
                    this.$tool
                        .request({
                            url: "MNG/MNG1/MNG141",
                            method: "post",
                            data: {
                                action: "del_intermethodsql",
                                hiscode: row.his_code,
                                methodcode: row.method_code,
                                seq: row.seq,
                            },
                        })
                        .then((res) => {
                            if (res == "1") {
                                this.$message({
                                    message: "删除成功！",
                                    type: "success",
                                });
                                this.get_intermethodsql(row.his_code, row.method_code);
                            } else {
                                this.$message.error(res);
                            }
                        })
                        .catch((e) => {
                            this.$message.error(e);
                        });
                })
                .catch(() => { });
        },
        dialog_methodsql_sureEvent() {
            this.methodsql_dialogflag = false;
        },
        add_methodsql_closeEvent() {
            this.init_add_methodsql_dialog_info();
            this.add_methodsql_dialogflag = false;
        },
        add_methodsql_saveEvent() {
            let ishaven = false;
            let row = this.$refs.add_methodsql_table.getCurrentRow();
            XE.each(this.dialog_methodsql_data, (item, index) => {
                if (item.seq == this.add_methodsql_dialog_info.seq && this.add_methodsql_dialog_info.seq != row.seq) {
                    ishaven = true;
                }
            });
            if (ishaven) {
                this.$message({
                    message: "序号重复！",
                    type: "warning",
                });
                return false;
            }
            let gdata = XE.clone(this.add_methodsql_dialog_info, true);
            gdata.islisdb = gdata.islisdb ? "1" : "0";
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "save_intermethodsql",
                        data: gdata,
                        flag: this.add_methodsql_name,
                    },
                })
                .then((res) => {
                    if (res == "1") {
                        this.add_methodsql_dialogflag = false;
                        this.get_intermethodsql(gdata.his_code, gdata.method_code);
                    } else {
                        this.$message.error(res);
                    }
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },

        tab_jktxxx_getdata(hiscode) {
            this.tab_jktxxx_Loading = true;
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "his_interoption_query",
                        hiscode: hiscode,
                    },
                })
                .then((res) => {
                    this.tab_jktxxx_data = res.Data;
                    this.tab_jktxxx_Loading = false;
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },
        DBChange(val) {
            switch (val) {
                case "SQL":
                    if (this.main_hisinterface_dialogflag) this.his_interface_info_F.servername = "IP地址,端口号";
                    else this.his_interface_info_B.servername = "IP地址,端口号";
                    break;
                case "ORACLE":
                    if (this.main_hisinterface_dialogflag) this.his_interface_info_F.servername = "IP地址:端口号/实例名";
                    else this.his_interface_info_F.servername = "IP地址:端口号/实例名";
                    break;
                case "MYSQL":
                    if (this.main_hisinterface_dialogflag) this.his_interface_info_F.servername = "IP地址:端口号";
                    else this.his_interface_info_F.servername = "IP地址:端口号";
                    break;
                default:
                    if (this.main_hisinterface_dialogflag) this.his_interface_info_F.servername = "";
                    else this.his_interface_info_F.servername = "";
                    break;
            }
            this.changeflag = true;
        },
        btn_saveinteroption_clickEvent() {
            this.$refs.tab_jktxxx_table.validate(async (valid) => {
                if (valid) {
                    let removeRecords = this.$refs.tab_jktxxx_table.getRemoveRecords();
                    let updateRecords = this.$refs.tab_jktxxx_table.getUpdateRecords();
                    let insertRecords = this.$refs.tab_jktxxx_table.getInsertRecords();
                    let _this = this;
                    if (removeRecords.length > 0 || updateRecords.length > 0 || insertRecords.length > 0) {
                        try {
                            const res = await this.$tool.request({
                                url: "MNG/MNG1/MNG141",
                                method: "post",
                                data: {
                                    action: "save_his_interoption",
                                    removeRecords: removeRecords,
                                    updateRecords: updateRecords,
                                    insertRecords: insertRecords,
                                },
                            });
                            if (res == "1") {
                                this.changeflag = false;
                            } else {
                                _this.$message.error(res);
                            }
                        } catch (e) {
                            _this.$message.error(e);
                        }
                    } else {
                        return false;
                    }
                } else {
                    this.$message.error("特殊选项主键校验错误！");
                    return false;
                }
            });
        },
        optioncode_changeEvent({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex }) {
            let _this = this;
            this.$nextTick(() => {
                XE.delay(
                    function (name) {
                        //校验主键重复
                        let insertRecords = _this.$refs.tab_jktxxx_table.getInsertRecords();
                        let indexno = 0;
                        XE.each(insertRecords, (item, key) => {
                            if (item.optioncode == row.optioncode) {
                                indexno++;
                            }
                        });
                        XE.each(_this.tab_jktxxx_data, (item, key) => {
                            if (item.optioncode == row.optioncode) {
                                indexno++;
                            }
                        });
                        if (indexno > 1) {
                            _this.$message.error("选项代码重复！");
                            row.optioncode = "";
                            return false;
                        } else {
                            this.changeflag = true;
                            return true;
                        }
                    },
                    200,
                    "test111"
                );
            });
        },

        //"rm-cancel"; //作废
        //"rm-disable"; //禁用
        //"rm-readonly"; //只读
        //"rm-alert"; //警告
        GetRowClassName({ row, rowIndex }) {
            if (row.inuse != "1") {
                return "rm-disable"; //禁用
            }
        },
        btn_interface_clickEvent() {
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "recoverhis_interface",
                    },
                })
                .then((res) => {
                    if (res == "1") {
                        this.$message({
                            message: "重启接口成功！",
                            type: "success",
                        });
                    } else {
                        //     this.$message.error("重启接口失败！" + res);
                        this.$alert("重启接口失败！<br/>" + res, "错误", {
                            dangerouslyUseHTMLString: true,
                        });
                    }
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },
        QueryHisInter() {
            this.dialogHisVisible = true;
            this.tablehisloading = true;
            this.$tool
                .request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "queryhisinter",
                    },
                })
                .then((res) => {
                    var Data = res.Data.filter((item) => item.ClassName != "InterObj_UserDefined");
                    this.tablehisdata = Data;
                    this.tablehisdatasearch = Data;
                    this.tablehisloading = false;
                    this.$nextTick(() => {
                        this.$refs.tablehis.setCurrentRow(this.$refs.tablehis.afterFullData[0]);
                    });
                })
                .catch((e) => {
                    this.$message.error(e);
                });
        },
        autosearch(val) {
            this.tablehisdatasearch = this.tablehisdata.filter((item) => item.Name.toUpperCase().indexOf(val.toUpperCase()) > -1 || item.ClassName.toUpperCase().indexOf(val.toUpperCase()) > -1 || item.Developer.toUpperCase().indexOf(val.toUpperCase()) > -1 || item.Tester.toUpperCase().indexOf(val.toUpperCase()) > -1 || item.MachineName.toUpperCase().indexOf(val.toUpperCase()) > -1 || item.Guid.toUpperCase().indexOf(val.toUpperCase()) > -1 || item.ReadMe.toUpperCase().indexOf(val.toUpperCase()) > -1);
        },
        searchkeydown() {
            this.tablehisdatasearch = this.tablehisdata.filter((item) => item.Name.toUpperCase().indexOf(this.qcode.toUpperCase()) > -1 || item.ClassName.toUpperCase().indexOf(this.qcode.toUpperCase()) > -1 || item.Developer.toUpperCase().indexOf(this.qcode.toUpperCase()) > -1 || item.Tester.toUpperCase().indexOf(this.qcode.toUpperCase()) > -1 || item.MachineName.toUpperCase().indexOf(this.qcode.toUpperCase()) > -1 || item.Guid.toUpperCase().indexOf(this.qcode.toUpperCase()) > -1 || item.ReadMe.toUpperCase().indexOf(this.qcode.toUpperCase()) > -1);
        },
        hissubmit() {
            var row = this.$refs.tablehis.getCurrentRow();

            if (this.main_hisinterface_dialogflag) this.his_interface_info_F.devclassname = row.ClassName;
            else this.his_interface_info_B.devclassname = row.ClassName;
            this.changeflag = true;
            this.dialogHisVisible = false;
        },
        tablehisdbl({ row }) {
            if (this.main_hisinterface_dialogflag) this.his_interface_info_F.devclassname = row.ClassName;
            else this.his_interface_info_B.devclassname = row.ClassName;
            this.changeflag = true;
            this.dialogHisVisible = false;
        },
        StartInterface() {
            if (this.his_interface_info_B.inuse) {
                this.his_interface_info_B.inuse = !this.his_interface_info_B.inuse;
                this.SaveAction(2).then(() => {
                    this.main_data_query();
                });
            } else {
                this.btn_testconnect_clickEvent()
                    .then(() => {
                        if (this.his_interface_info_B.interfacetype == "DEV" && this.his_interface_info_B.devclassname) {
                            this.TestConnetBeforeInUse()
                                .then(() => {
                                    this.his_interface_info_B.inuse = !this.his_interface_info_B.inuse;
                                    this.SaveAction(2).then(() => {
                                        this.main_data_query();
                                    });
                                })
                                .catch(() => {
                                    this.$confirm("当前接口与配置数据库连接失败，是否继续启用?", "提示", {
                                        confirmButtonText: "确定",
                                        cancelButtonText: "取消",
                                        type: "warning",
                                    }).then(() => {
                                        this.his_interface_info_B.inuse = !this.his_interface_info_B.inuse;
                                        this.SaveAction(2).then(() => {
                                            this.main_data_query();
                                        });
                                    });
                                });
                        } else {
                            this.his_interface_info_B.inuse = !this.his_interface_info_B.inuse;
                            this.SaveAction(2).then(() => {
                                this.main_data_query();
                            });
                        }
                    })
                    .catch(() => { });
            }
        },
        CancelChange() {
            this.$confirm("此操作将取消所有改动，是否继续?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                this.main_data_query();
            });
        },
        ExportCsv() {
            this.$confirm("请问您需要按一个接口一个文件的方式导出还是所有接口一个文件的方式导出?", "提示", {
                confirmButtonText: "一个接口一个文件",
                cancelButtonText: "所有接口一个文件",
                type: "warning",
            })
                .then(() => {
                    let p = { prgno: "MNG141C" };
                    this.$pub.bigdataexport(this, p, "HIS接口导出(" + this.currentHospName + ").zip", "正在导出，请稍候。。。");
                    //window.open(this.$tool.baseUrl.replace(/api/, "z") + "filedownload?file=HIS接口设置&action=MNG141C&hospcode=" + this.$tool.getSession(this.$tool.selectedhis));
                })
                .catch(() => {
                    let p = { prgno: "MNG141S" };
                    this.$pub.bigdataexport(this, p, "HIS接口导出(全部接口)(" + this.currentHospName + ").dat", "正在导出，请稍候。。。");
                    //window.open(this.$tool.baseUrl.replace(/api/, "z") + "filedownload?file=HIS接口设置&action=MNG141S&hospcode=" + this.$tool.getSession(this.$tool.selectedhis));
                });
        },
        ImportCsv() {
            this.$rm_uploadFiles({
                type: "文件上传",
                prgname: "MNG141",
                btn: {
                    confirmBtnText: "立即上传",
                    cancelBtnText: "取消",
                },
            })
                .then((res) => {
                    if (res.flag == "1") {
                        this.$notify.success({
                            title: "成功",
                            message: `文件上传成功`,
                        });
                        this.main_data_query();
                    } else {
                        this.$notify.error({
                            title: "错误",
                            message: `文件上传失败`,
                        });
                    }
                })
                .catch((e) => {
                    console.log("error", e);
                });
        },
        cellClassName({ row, column }) {
            if (column.property == "method_name") {
                if (row.method_code == "GET_REQ_INFO" || row.method_code == "GET_PATINFO" || row.method_code == "GET_OUTP_ORDERS" || row.method_code == "GET_INP_ORDERS" || row.method_code == "GET_RECORDID_EXECUTEFLAG" || row.method_code == "REQCHARGE") return "disabled-cell";
            }
        },
        logpass_dblclick() {
            if (window.event.shiftKey) {
                this.getdetextshow(1);
            }
        },
        superlogpass_dblclick() {
            if (window.event.shiftKey) {
                this.getdetextshow(2);
            }
        },
        async getdetextshow(ty) {
            try {
                let res = await this.$tool.request({
                    url: "MNG/MNG1/MNG141",
                    method: "post",
                    data: {
                        action: "getdetextshow",
                        hiscode: this.his_interface_info_B.his_code,
                        ty: ty,
                    },
                });
                if (res) {
                    this.$alert(res);
                } else {
                    this.$alert("获取密码失败！");
                }
            } catch (err) {
                console.log(err);
            }
        },
        //无条码不执行复选框增加密码验证
        nobarcodeundo_click(t) {
            if (t == 0) {
                //点了取消按钮
                this.nobarcodeundoVisible = false;
                if (this.his_interface_info_B.nobarcodeundo) {
                    this.his_interface_info_B.nobarcodeundo = false;
                }
            } else if (t == 1) {
                //点了确定按钮
                if (this.his_interface_info_B.nobarcodeundo) {
                    if (!this.nobarcodeundoPwd) {
                        this.$alert("请输入密码！", "提示");
                    } else if (this.nobarcodeundoPwd == this.$pub.getPwd()) {
                        this.his_interface_info_B.nobarcodeundo = true;
                        this.nobarcodeundoVisible = false;
                        this.HasChange();
                    } else {
                        this.$alert("密码错误，请重新输入密码！", "提示");
                    }
                } else {
                }
            }
        },
        nobarcodeundoChange() {
            this.nobarcodeundoPwd = "";
            if (this.his_interface_info_B.nobarcodeundo) {
                this.nobarcodeundoVisible = true;
                setTimeout(() => {
                    this.$refs.RefnobarcodeundoPwd.focus();
                }, 3);
            } else {
                this.HasChange();
            }
        },
        //改变线程需密码验证
        servicethread_click(t) {
            if (t == 0) {
                //点了取消按钮
                this.servicethreadVisible = false;
                this.his_interface_info_B.servicethread = XE.clone(this.oldhis_interface_info_B.servicethread, true);
            } else if (t == 1) {
                //点了确定按钮
                if (this.his_interface_info_B.servicethread) {
                    if (!this.servicethreadPwd) {
                        this.$alert("请输入密码！", "提示");
                    } else if (this.servicethreadPwd == this.$pub.getPwd()) {
                        this.servicethreadVisible = false;
                        this.HasChange();
                    } else {
                        this.$alert("密码错误，请重新输入密码！", "提示");
                    }
                } else {
                }
            }
        },
        servicethreadChange() {
            this.servicethreadPwd = "";
            this.servicethreadVisible = true;
            setTimeout(() => {
                this.$refs.RefservicethreadPwd.focus();
            }, 3);
        },
        LookInterfaceDesc() {
            if (this.his_interface_info_B.interfacetype == "DEV") {
                if (!!this.his_interface_info_B.devclassname) {
                    this.dialoginterfacedesc = true;
                    this.$tool
                        .request({
                            url: "MNG/MNG1/MNG141",
                            method: "post",
                            data: {
                                action: "getdevinterfacedesc",
                                classname: this.his_interface_info_B.devclassname,
                            },
                        })
                        .then((res) => {
                            if (res.errcode == "0") {
                                this.devinterfacedesc = res.data.ReadMe;
                            } else {
                                this.$alert(res.errmsg);
                            }
                        })
                        .catch((e) => {
                            this.$message.error(e);
                        });
                }
            }
        },
    },
    watch: {
        his_interface_info_B(val) {
            if (val) {
                if (val.inuse) {
                    this.buttontxt = "禁用";
                } else {
                    this.buttontxt = "启用";
                }
            }
        },
    },
};
</script>

<style scoped>
::v-deep .vxe-body--row.row-stop {
    color: white !important;
    background-color: rgb(255, 192, 192) !important;
}

::v-deep .vxe-body--row.row-new {
    color: red !important;
}

::v-deep .vxe-body--row.row-green {
    background-color: #187 !important;
    color: #fff;
}

::v-deep .vxe-body--column.col-red {
    background-color: red;
    color: #fff;
}

::v-deep .el-input.is-disabled .el-input__inner {
    color: black;
}

::v-deep .el-checkbox.is-disabled .el-checkbox__label {
    color: black;
}

::v-deep .el-textarea.is-disabled .el-textarea__inner {
    color: black;
}

::v-deep .rm-disable {
    cursor: default;
}

::v-deep .el-checkbox__inner::after {
    border: 2px solid #000000 !important;
    box-sizing: content-box;
    content: "";
    border-left: 0 !important;
    border-top: 0 !important;
    height: 7px;
    left: 4px;
    position: absolute;
    top: 1px;
    transform: rotate(45deg) scaleY(0);
    width: 3px;
    transition: transform 0.15s ease-in 0.05s;
    transform-origin: center;
}

::v-deep .el-checkbox__input.is-disabled+span.el-checkbox__label {
    color: #000000;
    cursor: not-allowed;
}

::v-deep .el-checkbox__input.is-disabled .el-checkbox__inner,
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner+.el-input.is-disabled .el-input__inner {
    background-color: #ffffff !important;
}

.el-main {
    padding: 0;
}

.pagetop {
    left: 0;
    right: 0;
    height: 36px;
    display: -webkit-box;
    -webkit-box-pack: center;
    -webkit-box-align: center;
    border: solid 1px #ccc;
    position: absolute;
    z-index: 99;
}

.pagecenter {
    position: absolute;
    top: 40px;
    width: 100%;
    left: 0;
    bottom: 0px;
    overflow: auto;
}

.middle-center {
    position: absolute;
    height: 100%;
    right: 675px;
    left: 0;
    overflow: auto;
}

.middle-right {
    background-color: chartreuse;
    position: absolute;
    top: 0;
    bottom: 0px;
    overflow: visible;
    width: 670px;
    right: 0px;
}

table tr td:nth-child(odd) {
    text-align: right;
    white-space: nowrap;
}

table tr td:nth-child(even) {
    text-align: left;
}

table tr td:nth-child(1) {
    width: 80px;
}

table {
    font-size: 12px;
    border-collapse: separate;
    border-spacing: 5px;
}

::v-deep .vxe-body--row .el-input--small .el-input__inner {
    height: 20px !important;
    line-height: 20px !important;
}

::v-deep .col--edit .vxe-cell {
    /* padding: 0 0; */
    padding-top: 0px;
    padding-right: 3px;
    padding-bottom: 0px;
    padding-left: 3px;
}

::v-deep .el-button.is-disabled {
    border: 0px;
    color: grey;
    background-color: #e6e6e6;
    font-weight: normal;
}

::v-deep .disabled-cell {
    color: rgb(252, 6, 6);
}

.vxe-table .vxe-cell {
    padding: 0 5px !important;
}

.table-bottom {
    position: absolute;
    left: 0px;
    bottom: 0px;
    z-index: 1;
    overflow: hidden;
    width: 100%;
    /* padding-left: 50px; */
}
</style>